package com.xuecheng.content.api;


import com.xuecheng.content.model.dto.CourseInfoDto;
import com.xuecheng.content.model.dto.CoursePreviewDto;
import com.xuecheng.content.service.CoursePublishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/open")
public class CourseOpenController {
    @Autowired
    private CoursePublishService coursePublishService;

    @GetMapping("/course/whole/{courseid}")
    public CoursePreviewDto getCoursePublish(@PathVariable("courseid") Long courseId) {
//      返回预览信息
        return coursePublishService.getCoursePreviewInfo(courseId);
    }
}
